package com.sc.nft.admin.controller;




import com.sc.nft.annotation.SysMemberLogin;
import com.sc.nft.entity.dto.AssessLogAdminPageVO;
import com.sc.nft.entity.dto.AssessLogAdminPageDTO;
import com.sc.nft.enums.ApplicationRequirementUpOrDownEnum;
import com.sc.nft.service.WorkCityServerAssessLogService;
import com.sc.nft.sup.PageResult;
import com.sc.nft.sup.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.Map;

/**
 * 考核记录表(WorkCityServerAssessLog)表控制层
 *
 * @author 王伟成
 * @since 2024-04-09 20:07:26
 */

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/admin/workCityServerAssessLog")
@Api(tags = "考核记录")
public class WorkCityServerAssessLogController {
    /**
     * 服务对象
     */
    private final WorkCityServerAssessLogService workCityServerAssessLogService;

    @PostMapping(value = "/assessPage", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "考核记录", notes = "考核记录", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public PageResult<AssessLogAdminPageVO> assessPage(@RequestBody AssessLogAdminPageDTO assessLogAdminPageDTO) {
        return PageResult.success(workCityServerAssessLogService.assessPage(assessLogAdminPageDTO));
    }


    @PostMapping(value = "/assessTypeScreening", produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "考核类型筛选", notes = "考核类型筛选", httpMethod = "POST", produces = MediaType.APPLICATION_JSON_VALUE)
    @SysMemberLogin
    public Result<Map<String,String>> assessTypeScreening() {
        return Result.success(ApplicationRequirementUpOrDownEnum.getAll());
    }
}
